package com.web.portal.controller.portal;

import com.web.portal.controller.admin.LabelArticeAdminApi;
import com.web.portal.response.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Slf4j
@RestController
@Api(tags = "文章标签中间表查看")
@RequestMapping("/label_artice")
public class LabelArticeController {
    @Autowired
    private LabelArticeAdminApi labelArticeAdminApi;

    /**
     * 获取 文章标签中间
     * <p>
     * 使用的case:修改的时候，获取一下。填充弹窗
     * 不获取也是可以的，从列表里获取数据
     * <p>
     *
     * @param labelArticeId
     * @return
     */
    @ApiOperation(value = "用id文章标签中间")
    @GetMapping("find_label_artice/{label_artice_id}")
    public ResponseResult getLabelArtice(@PathVariable("label_artice_id") String labelArticeId) {
        return labelArticeAdminApi.getLabelArtice(labelArticeId);
    }

    // 查询带分页
    @ApiOperation(value = "分类查询带分页")
    @PostMapping("find_label_artice/{current}/{limit}")
    public ResponseResult findLabelArtice(@PathVariable long current,
                                          @PathVariable long limit) {
        return labelArticeAdminApi.findLabelArtice(current, limit);
    }
}
